SQL vs NoSQL
The two main types of databases.
SQL
SQL - Structured Query Language
- SQL groups data into tables, which is good for things like names or addresses
- It is very good at relationships between data tables
- ex. Can link
customerstable toorderstable bycustomer id, and linkproductstable toorderstable byproduct id
- ex. Can link
- Not very flexible - doesn't like having gaps
- Inserts a
nullif something isn't there, like if someone ops not to submit and email address
- Inserts a
NoSQL
NoSQL - Not Only SQL
- Can function like JSON objects. Things don't have to have all the same fields or same structure
- Non-relational - won't be as fast as SQL database for searching relational data
- More flexible, newer
- Better for scaling
Popular Databases with Node
note
There are many database options out there. These are just a few.
Popular SQL Databases
Popular NoSQL Databases
MySQL vs MongoDB
| MySQL | MongoDB |
|---|---|
| SQL | NoSQL |
| More Mature | Shiny and New |
| Table Structure | Document Structure |
| Requires a Schema | More Flexible to Changes |
| Great with Relationships | Not Great with Complex Relationships |
| Scales Vertically | Scales Horizontally |
Create, Read, Update, Destroy
Otherwise known as CRUD - these are the most important things you'll do with any database.